package com.itkm.eurekaprovider.service.impl;

import com.itkm.eurekaprovider.mapper.CommentMapper;
import com.itkm.eurekaprovider.service.CommentService;
import com.itkm.pojo.Comment;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Optional;

@Service
public class CommentServiceImpl implements CommentService {
    @Resource
    private CommentMapper commentMapper;
    @Override
    public List<Comment> getComments() {
        return commentMapper.selectAll();
    }
    @Override
    public Optional<Comment> getCommentById(int id) {
        return Optional.ofNullable(commentMapper.selectById(id));
    }
}
